//
//  StatusBottomView.swift
//  weibo
//
//  Created by Fosen on 15/12/5.
//  Copyright © 2015年 fosen. All rights reserved.
//

import UIKit
import SnapKit

class StatusBottomView: UIView {

    override init(frame: CGRect) {
        
        super.init(frame: frame)
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    
    private func setupUI(){
    
    
        backgroundColor = UIColor(white: 0.98, alpha: 1)
        addSubview(retweetBtn)
        addSubview(commentBtn)
        addSubview(unlikeBtn)
        
        retweetBtn.snp_makeConstraints { (make) -> Void in
            
            make.left.top.bottom.equalTo(self)
        }
        commentBtn.snp_makeConstraints { (make) -> Void in
            
            make.left.equalTo(retweetBtn.snp_right)
            make.top.bottom.equalTo(self)
            //2
            make.width.equalTo(retweetBtn.snp_width)
        }
        unlikeBtn.snp_makeConstraints { (make) -> Void in
            
            make.left.equalTo(commentBtn.snp_right)
            //1
            make.width.equalTo(retweetBtn.snp_width)
            make.right.equalTo(self.snp_right)
            
            make.top.bottom.equalTo(self)
        }
        
       
        let sepView1 = sepView()
        let sepView2 = sepView()
        addSubview(sepView1)
        addSubview(sepView2)
        let w = 0.5
        let scale = 0.4
        
        sepView1.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(retweetBtn.snp_right)
            make.centerY.equalTo(self.snp_centerY)
            make.height.equalTo(self.snp_height).multipliedBy(scale)
            make.width.equalTo(w)
        }
        sepView2.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(commentBtn.snp_right)
            make.centerY.equalTo(self.snp_centerY)
            make.height.equalTo(self.snp_height).multipliedBy(scale)
            make.width.equalTo(w)
        }
        
    }
    private func sepView() ->UIView{
        
        let v = UIView()
        v.backgroundColor = UIColor.lightGrayColor()
        return v
        
    }
    
    
    
    //懒加载视图
    private lazy var retweetBtn : UIButton = UIButton(title: "转发", backImage: nil, color: UIColor.darkGrayColor(), fontSize: 10,imageName: "timeline_icon_retweet",isNeedHighlighted: false)
    
    private lazy var commentBtn : UIButton = UIButton(title: "评论", backImage: nil, color: UIColor.darkGrayColor(), fontSize: 10,imageName: "timeline_icon_comment",isNeedHighlighted: false)

    private lazy var unlikeBtn : UIButton = UIButton(title: "赞", backImage: nil, color: UIColor.darkGrayColor(), fontSize: 10,imageName: "timeline_icon_unlike",isNeedHighlighted: true)

    
}
